package at.technikum.bic.ese.hatcam;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class HatcamMainActivity extends TabActivity {

	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    Resources res = getResources(); // Resource object to get Drawables
	    TabHost tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab

	    intent = new Intent().setClass(this, HatcamPreferences.class);
	    spec = tabHost.newTabSpec("settings").setIndicator("Einstellungen",
	                      res.getDrawable(R.drawable.ic_tab_settings))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    intent = new Intent().setClass(this, CameraPreviewActivity.class);
	    spec = tabHost.newTabSpec("camerapreview").setIndicator("Kamera",
	                      res.getDrawable(R.drawable.ic_tab_camera))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    intent = new Intent().setClass(this, PicturePreviewActivity.class);
	    spec = tabHost.newTabSpec("picturepreview").setIndicator("Bilder",
	                      res.getDrawable(R.drawable.ic_tab_pictures))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    intent = new Intent().setClass(this, WifiManagementActivity.class);
	    spec = tabHost.newTabSpec("wifimanagement").setIndicator("Wifi",
	                      res.getDrawable(R.drawable.ic_tab_wifi))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    tabHost.setCurrentTab(0);
	}
}
